import type { Case } from "@/types/response/case";
import {defineStore} from "pinia";
import {ref} from "vue";
let useCaseStore=defineStore("caseStore",()=>{
    let caseMap=ref<Map<number,Case>>(new Map());
    function addCases(c:Case[]){
        for(let i of c){
            caseMap.value.set(i.caseId,i);
        }
    }
    function deleteCase(id:number){
        caseMap.value.delete(id);
    }
    return {
        caseMap,
        addCases,
        deleteCase
    };
},{
    
})
export default useCaseStore;